#pragma once

#include<iostream>
#include<cstdio>
#include<string>
#include<functional>

//2.任务类型为函数
//using Task = std::function<void()>;

//1.任务类型为类对象
class Task   
{
public:
    Task(){ }
    
    Task(int a, int b)
    { 
        _a = a;
        _b = b;
    }

    void Excute()
    { 
        _result = _a + _b;
    }

    void operator()() //*仿函数
    {
        Excute();
    }

    std::string ResultToString()
    {
        std::string ret = std::to_string(_a) + "+" + std::to_string(_b) + "=" + std::to_string(_result);
        return ret;
    }

    std::string DebugToString()
    {
        std::string ret = std::to_string(_a) + "+" + std::to_string(_b) + "=?";
        return ret;
    }

private:
    int _a;
    int _b;
    int _result;
};